import os
os.environ["HF_HUB_DISABLE_SYMLINKS_WARNING"] = "1"

from pyabsa import TextClassification as TC

# 加载预训练情感分析模型
classifier = TC.SentimentClassifier(checkpoint='english')

# 预测
text = "I love this movie! It's fantastic."
result = classifier.predict(
    text,
    print_result=True,
    ignore_error=False,
)